home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / x / xview / xview3.004 / xview3 / usr / openwin / include / pixrect / gp1reg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-30  |  3.8 KB  |  153 lines

  1. /* @(#)gp1reg.h 1.11 89/03/14 SMI */
  2.  
  3. /*
  4.  * Copyright 1985, 1987 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef        _sundev_gp1reg_h
  8. #define    _sundev_gp1reg_h
  9.  
  10. #define    GP1_SIZE        65536
  11. #define    GP1_SHMEM_SIZE        32768
  12. #define    GP1_SHMEM_OFFSET    32768
  13. #define    GP2_SHMEM_SIZE        0x20000
  14.  
  15. #define    GP2_SIZE        262144
  16.  
  17. #define    GP1_BLOCK_SHORTS    512
  18. #define    GP1_BLOCKS        32
  19. #define    GP1_CONTROL_BLOCKS    1
  20. #define    GP1_POST_BLOCKS        23
  21. #define    GP1_STATIC_BLOCKS    8
  22.  
  23. #define    GP1_POST_SLOTS        256
  24.  
  25. /* GP1 board layout */
  26. struct gp1 {
  27.     union gp1_reg {
  28.         struct gp1reg {
  29.             short gpr_ident;
  30.             union {
  31.                 short status;
  32.                 short control;
  33.             } gpr_csr;
  34.             short gpr_ucode_addr;
  35.             short gpr_ucode_data;
  36.         } reg;
  37.         struct gp2reg {
  38.             short ident;
  39.             short :16;
  40.             u_int xp_addr;
  41.             u_int xp_data_h;
  42.             u_int xp_data_l;
  43.             u_int rp_addr;
  44.             u_int rp_data;
  45.             u_int pp_addr;
  46.             u_int pp_data_h;
  47.             u_int pp_data_l;
  48.             u_int status;
  49.             u_int control;
  50.             u_int pp_addr2;
  51.         } reg2;
  52.         u_short ureg[16384];
  53.     } reg;
  54.     struct gp1_shmem {
  55.         u_short    host_count;
  56.         u_short gp_count;
  57.         u_char ver_flag;
  58.         u_char alloc_sem;
  59.         u_short host_alloc_h;
  60.         u_short host_alloc_l;
  61.         u_short gp_alloc_h;
  62.         u_short gp_alloc_l;
  63.         u_char flag2;
  64.         u_char post_sem;
  65.         u_short post_buf[GP1_POST_SLOTS];
  66.         u_char block_owners[GP1_BLOCKS];
  67.         u_short fill280[228];
  68.         u_short ver_release;
  69.         u_short ver_serial;
  70.         u_short fill510[2];
  71.         u_short post[GP1_POST_BLOCKS][GP1_BLOCK_SHORTS];
  72.         u_short stat[GP1_STATIC_BLOCKS][GP1_BLOCK_SHORTS];
  73.     } shmem;
  74. };
  75.  
  76. /* convert block number to bit mask, owner array index */
  77. #define    GP1_ALLOC_BIT(blk)    ((u_long) 0x80000000 >> (blk))
  78. #define    GP1_OWNER_INDEX(blk)    (GP1_BLOCKS - 1 - (blk))
  79.  
  80. /* register offsets and bit definitions */
  81.  
  82. #define    GP1_BOARD_IDENT_REG    0
  83. #define    GP1_ID_MASK        0xfe
  84. #define    GP1_ID_VALUE        0xea
  85.  
  86. #define    GP1_CONTROL_REG        1
  87. #define    GP1_CR_CLRIF        0x8000
  88. #define    GP1_CR_IENBLE        0x0300
  89. #define    GP1_CR_INT_TOGGLE    0x0300
  90. #define    GP1_CR_INT_DISABLE    0x0200
  91. #define    GP1_CR_INT_ENABLE    0x0100
  92. #define    GP1_CR_INT_NOCHANGE    0x0000
  93. #define    GP1_CR_RESET        0x0040
  94. #define    GP1_CR_VP_CONTROL    0x0038
  95. #define    GP1_CR_VP_STRT0        0x0020
  96. #define    GP1_CR_VP_HLT        0x0010
  97. #define    GP1_CR_VP_CONT        0x0008
  98. #define    GP1_CR_PP_CONTROL    0x0007
  99. #define    GP1_CR_PP_STRT0        0x0004
  100. #define    GP1_CR_PP_HLT        0x0002
  101. #define    GP1_CR_PP_CONT        0x0001
  102.  
  103. #define    GP1_STATUS_REG        1
  104. #define    GP1_SR_IFLG        0x8000
  105. #define    GP1_SR_IEN        0x4000
  106. #define    GP1_SR_RESET        0x0400
  107. #define    GP1_SR_VP_STATE        0x0200
  108. #define    GP1_SR_PP_STATE        0x0100
  109. #define    GP1_SR_VP_STATUS    0x00F0
  110. #define    GP1_SR_PP_STATUS    0x000F
  111.  
  112. #define    GP1_UCODE_ADDR_REG    2
  113. #define    GP1_UCODE_DATA_REG    3
  114.  
  115.  
  116. /* GP2 definitions */
  117. #define    GP2_ID_MASK        0xff
  118. #define    GP2_ID_VALUE        0xec
  119.  
  120. /* GP2 control register bits (active low) */
  121. #define    GP2_CR_XP_RST        0x40000000
  122. #define    GP2_CR_XP_HLT        0x20000000
  123. #define    GP2_CR_RP_RST        0x10000000
  124. #define    GP2_CR_RP_HLT        0x08000000
  125. #define    GP2_CR_PP_RST        0x02000000
  126. #define    GP2_CR_PP_HLT        0x01000000
  127.  
  128. /* GP2 status register message shifts */
  129. #define    GP2_SR_XPMSG_SHIFT    16
  130. #define    GP2_SR_RPMSG_SHIFT    8
  131. #define    GP2_SR_PPMSG_SHIFT    0
  132.  
  133.  
  134. /* shared memory offsets */
  135. #define    GP1CB_HOST_COUNT    0    /* host command count */
  136. #define    GP1CB_GP_COUNT        1    /* GP command count */
  137. #define    GP1CB_ALLOC_SEM        2    /* buffer allocation semaphore */
  138. #define    GP1CB_HOST_ALLOC_H    3    /* host block allocation bit vector */
  139. #define    GP1CB_HOST_ALLOC_L    4    /*    high/low */
  140. #define    GP1CB_GP_ALLOC_H    5    /* GP block allocation bit vector */
  141. #define    GP1CB_GP_ALLOC_L    6    /*    high/low */
  142. #define    GP1CB_POST_SEM        7    /* command posting semaphore */
  143. #define    GP1CB_POST_BUF        8    /* command posting buffer, 256 words */
  144. #define    GP1CB_BLOCK_OWNERS    264    /* minor device number for owner */
  145.                     /* of each block -- reverse order! */
  146.  
  147. #define    GP1CB_VER_FLAG        2    /* version info is valid if */
  148.                     /*    high byte is 1 */
  149. #define    GP1CB_VER_RELEASE    508    /* major/minor release numbers */
  150. #define    GP1CB_VER_SERIAL    509    /* serial number/version flag */
  151.  
  152. #endif    /*  _sundev_gp1reg_h  */
  153.